Allow osdctl rhobs logs to accept HCP cluster IDs#893
Conversation
Remove the early return that rejected HCP cluster IDs for log queries. HCP IDs are now auto-resolved to their parent MC, matching the behavior that metrics already had. The HCP external ID is still used for the openshift_cluster_id log filter. This simplifies the UX by accepting any cluster ID (HCP, MC, or SC) for all three osdctl rhobs subcommands (metrics, logs, cell).
WalkthroughThe PR updates the RHOBS MCP logs tool to accept HCP cluster IDs in addition to MC cluster IDs. HCP cluster IDs are automatically resolved to their parent management cluster for RHOBS queries. Documentation and implementation are aligned: tool schema is updated to reflect the broadened input, and the cluster resolution logic removes the prior HCP rejection for logs. ChangesHCP cluster ID support for RHOBS logs
Possibly related PRs
Suggested labels
Suggested reviewers
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dustman9000, joshbranham The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@dustman9000: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Previously
osdctl rhobs logsrejected HCP cluster IDs with an error telling users to find the parent MC ID. This was a UX regression fromosdctl dt logswhich accepted any cluster ID.Now HCP IDs are auto-resolved to their parent MC (same as
osdctl rhobs metricsalready did). The HCP external ID is still used for theopenshift_cluster_idlog filter so logs are correctly scoped to the HCP.All three
osdctl rhobssubcommands (metrics, logs, cell) now accept any cluster ID (HCP, MC, or SC).Usage examples
Tested
prometheus-k8s-0filters correctlyAlso updates the MCP tool description to reflect that any cluster ID is accepted.
Fixes: https://github.com/openshift/ops-sop/pull/3993
Summary by CodeRabbit
rhobs_logstool now accepts any cluster ID, with Hosted Control Plane (HCP) cluster IDs automatically resolved to their parent Management Cluster for log resolution.